﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WaterBill.DAL;
using WaterBill.DTO;
using System.Data;

namespace WaterBill.BUS
{
    class BUS_Nests : DAL_Nests
    {
        DataTable dtN;

        //Lay danh sach tat ca cac to
        public DataTable BUS_Nests_GetAll()
        {
            dtN = new DataTable();
            try
            {
                dtN = DAL_Nests_GetAll();
            }
            catch
            {
            }
            return dtN;
        }

        //Lay danh sach cac to dua vao HamletId
        public DataTable BUS_Nests_GetByHamletId(int HamletId)
        {
            dtN = new DataTable();
            try
            {
                dtN = DAL_Nests_GetByHamletId(HamletId);
            }
            catch
            {
            }
            return dtN;
        }

        //Them mot to moi vao ap
        public Boolean BUS_Nets_Insert(DTO_Nests obj)
        {
            try
            {
                if (DAL_Nests_Insert(obj))
                {
                    return true;
                }
            }
            catch
            {
            }
            return false;
        }

        //Sua to
        public Boolean BUS_Nests_Update(DTO_Nests obj)
        {
            try
            {
                if (DAL_Nests_Update(obj))
                {
                    return true;
                }
            }
            catch
            {
            }
            return false;
        }

        //Xoa to
        public Boolean BUS_Nests_Delete(int NestId)
        {
            try
            {
                if (DAL_Nests_Delete(NestId))
                {
                    return true;
                }
            }
            catch
            {
            }
            return false;
        }
    }
}
